package cn.bmbanjia.zebra2024.mybatisflex.req;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class PageReq {

    @NotNull
    @Min(1)
    private Integer page;

    @NotNull
    @Min(1)
    private Integer length;

    public Integer offset() {
        return (page - 1) * length;
    }

}
